home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992…tember: A ROM With a View / devSep92 / devSep92.dmg / Tools & Apps / Testing & Debugging / Report Error 1.2 / testReportError.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-31  |  1.7 KB  |  86 lines  |  [TEXT/KAHL]

  1. /*================================================================================
  2.     testReportError.c
  3.     
  4.     A simple test of the 'ReportError' package
  5. ================================================================================*/
  6. #include "reportError.h"
  7.  
  8. /*
  9. // Macintosh includes
  10. */
  11. #ifndef __TYPES__
  12.     #include <Types.h>
  13. #endif
  14. /*
  15. //#ifndef __SYSEQU__
  16. //    #include <SysEqu.h>
  17. //#endif
  18. */
  19. #ifndef __ERRORS__
  20.     #include <Errors.h>
  21. #endif
  22. #ifndef __MEMORY__
  23.     #include <Memory.h>
  24. #endif
  25. #ifndef __MENUS__
  26.     #include <Menus.h>
  27. #endif
  28. #ifndef __FONTS__
  29.     #include <Fonts.h>
  30. #endif
  31. #ifndef __EVENTS__
  32.     #include <Events.h>
  33. #endif
  34. #ifndef __OSEVENTS__
  35.     #include <OSEvents.h>
  36. #endif
  37.  
  38. /*
  39. // The following includes are needed by MPW, but not Think C
  40. // (they don't hurt, though)
  41. */
  42. #ifndef __DIALOGS__
  43.     #include <Dialogs.h>
  44. #endif
  45. #ifndef __TEXTEDIT__
  46.     #include <TextEdit.h>
  47. #endif
  48. #ifndef __WINDOWS__
  49.     #include <Windows.h>
  50. #endif
  51.  
  52. void InitAll( void );
  53.  
  54. /*--------------------------------------------------------------------------------
  55.     Initialize all of the relivant Macintosh managers
  56. --------------------------------------------------------------------------------*/
  57. void InitAll()
  58. {
  59.     MaxApplZone();
  60.     
  61.     InitGraf( &(qd.thePort) );
  62.     InitFonts();
  63.     FlushEvents(everyEvent, 0);
  64.     InitWindows();
  65.     InitMenus();
  66.     TEInit();
  67.     InitDialogs(0L);
  68.     
  69.     InitCursor();
  70. }
  71.  
  72.  
  73. /*--------------------------------------------------------------------------------
  74.     A short test of 'ReportError'
  75. --------------------------------------------------------------------------------*/
  76. main()
  77. {
  78.     Handle            testHandle;
  79.     
  80.  
  81.     InitAll();
  82.             
  83.     testHandle = NewHandle( 0x7FFFFFFF );
  84.     ReportError( (unsigned char*)"\pThe memory block could not be allocated", MemError() );
  85. }
  86.